package com.swak.hazelcast;

import com.hazelcast.core.HazelcastInstance;
import com.swak.cache.AbstractCacheManager;
import com.swak.cache.Cache;
import com.swak.cache.LocalCache;

public class HazelcastCacheManager extends AbstractCacheManager {

	private HazelcastInstance hazelcast;

	public HazelcastCacheManager(HazelcastInstance hazelcast) {
		this.hazelcast = hazelcast;
	}

	@Override
	public LocalCache<Object> getLocalCache() {
		return null;
	}

	@Override
	protected <T> Cache<T> createCache(String name, int timeToIdle, boolean idleAble) {
		return new HazelcastCache<T>(name, timeToIdle, idleAble).setCacheManager(this);
	}

	public HazelcastInstance getHazelcast() {
		return hazelcast;
	}
}
